package perl.lexical.classes;


public class Delimeter extends TokenClass {

	public final static String LPAR = "(";
	public final static String RPAR = ")";
	public final static String LBRA = "{";
	public final static String RBRA = "}";
	public final static String SEMICOLON = ";";
	public final static String COMMA = ",";
	public final static String POINT = ".";
	public final static String SINQUATE = "'";
	public final static String MULQUATE = "\"";
	public final static String SHARP = "#";
	public final static String COLON = ":";
	
	public final static String[] delimeters = { LPAR, RPAR, LBRA, RBRA,
			SEMICOLON, COMMA, POINT, SINQUATE, MULQUATE, SHARP, COLON };

	@Override
	public Token generateToken(String lexem) {
		
		String del = lexem.substring(0,1);
		
		for (String delimeter : delimeters) {

			if (delimeter.equals(del)) {
				return new Token(className, del);
			}
		}

		return null;
	}

	public Delimeter() {
		className = TokenClassEnum.DELIMETER;
	}

}
